package com.du.dupload;

import java.awt.Font;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class SwingMenu extends JMenuBar {
	SwingMenu() {
		Font font = new Font("Verdana", Font.PLAIN, 11);
		ImageIcon buttonIcon = new ImageIcon(
				SwingContainer.class.getResource("/res/ConfigIcon.png"));
		JMenu fileMenu = new JMenu("File");
		fileMenu.setFont(font);
		fileMenu.setMargin(new Insets(0, 10, 0, 10));

		JMenuItem newMenu = new JMenuItem("Config", buttonIcon);
		newMenu.setFont(font);
		fileMenu.add(newMenu);

		fileMenu.addSeparator();

		JMenuItem exitItem = new JMenuItem("Exit");
		exitItem.setFont(font);
		fileMenu.add(exitItem);

		exitItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		
		add(fileMenu);
	}
}
